

#import "LLNoDataView.h"

@implementation LLNoDataView

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self initSubViews];
    }
    return self;
}

- (void)initSubViews {
    _imgView = [UIImageView new];
//    _imgView.frame = CGRectMake(0, self.height * 0.3, <#CGFloat width#>, <#CGFloat height#>)
    [self addSubview:_imgView];
    
    _label = [LLInitBaseViewTool labelWithText:nil textColor:LLColorRGB(153) font:14 textAlignment:NSTextAlignmentCenter];
    [self addSubview:_label];
}

- (void)setNoDataView:(NSString *)imageName title:(NSString *)title {
    UIImage *image = [UIImage imageNamed:imageName];
    _imgView.image = [UIImage imageNamed:imageName];
    _imgView.frame = CGRectMake((self.width - image.size.width)/2.0, self.height * 0.3, image.size.width, image.size.height);
    _label.text = title;
    _label.frame = CGRectMake(0, _imgView.bottom + 15, self.width, 30);
}

- (void)setNoDataViewTitle:(NSString *)title{
    _label.text = title;
    _label.frame = CGRectMake(0, 60, self.width, 20);
}

@end
